﻿using DataServer.ApplicationLib.Entities;

namespace DataServer.ApplicationLib.Rules
{
    public static class RuleVerifyExtension
    {
        public static IRuleVerify? ParaseRuleVerify(this ConfigRuleEntity configRuleEntity, string? checkWay)
        {
            IRuleVerify? retObj = null;

            if (!string.IsNullOrEmpty(configRuleEntity.RuleContent))
            {
                retObj = RuleVerifyFactory.CreateVerify(new CreateRuleVerifyInput()
                {
                    TemplateCode = configRuleEntity.TemplateCode,
                });
            }

            return retObj;
        }
    }
}
